{extend name="common/adminBase" /}
{block name="body"}
<style>
    .layui-input-inline{
        width: 400px !important;
    }
    .layui-form-label{
         width: 120px !important;
    }
</style>
    <body >
        <div class="layui-fluid">
            <div class="layui-row">
                <form class="layui-form">

                    {if $admin.lv==3||$admin.lv==2}
                    <div class="layui-form-item">
                        <label for="username" class="layui-form-label">
                            <span class="x-red">*</span>管理部门
                        </label>
                        <div class="layui-input-inline">
                           <input type="text"   value="{$bumen}" required="" 
                          autocomplete="off" class="layui-input" readonly="">
                        </div>

                    </div>
                    {/if}
                  <div class="layui-form-item">
                      <label for="username" class="layui-form-label">
                          <span class="x-red">*</span>管理员真实姓名
                      </label>
                      <div class="layui-input-inline">
                          <input type="text"  name="name" value="{$admin.name}" required="" lay-verify="required"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>

                    <div class="layui-form-item">
                        <label for="username" class="layui-form-label">
                            <span class="x-red">*</span>手机号码
                        </label>
                        <div class="layui-input-inline">
                            <input type="text"  name="phone" value="{$admin.phone}" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="username" class="layui-form-label">
                            <span class="x-red">*</span>身份证号
                        </label>
                        <div class="layui-input-inline">
                            <input type="text"  name="idcard" value="{$admin.idcard}" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                  <div class="layui-form-item">
                        <label for="username" class="layui-form-label">
                            <span class="x-red">*</span>email邮箱
                        </label>
                        <div class="layui-input-inline">
                            <input type="text"  name="email" value="{$admin.email}" autocomplete="off" class="layui-input">
                        </div>
                  </div>
                  <div class="layui-form-item">
                        <label for="username" class="layui-form-label">
                            <span class="x-red">*</span>登录密码
                        </label>
                        <div class="layui-input-inline">
                            <input type="text"  name="password" value="" autocomplete="off" class="layui-input">
                        </div>

                  </div>

                    <input type="hidden" name="id" value="{$admin.id}">
                  <div class="layui-form-item">
                      <label for="L_repass" class="layui-form-label">
                      </label>
                      <button  class="layui-btn" lay-filter="add" lay-submit="">
                          修改
                      </button>
                  </div>
              </form>
            </div>
        </div>
        <script>layui.use(['form', 'layer'],
            function() {
                $ = layui.jquery;
                var form = layui.form,
                layer = layui.layer;

                //监听提交
                form.on('submit(add)', function(data) {
                    console.log(data);
                    //发异步，把数据提交给php
                    $.ajax({
                        url:"",
                        data:data.field,
                        type:'post',
                        dataType:'json',
                        success:function (res) {
                            if (res.status==1){
                                layer.msg(res.msg,{icon:6,time:1500},function() {
                                    //关闭当前frame
                                    xadmin.close();
                                    // 可以对父窗口进行刷新
                                    xadmin.father_reload();
                                });
                            }else{
                                layer.alert(res.msg,function (index) {
                                    layer.close(index);
                                })
                            }
                        }
                    })

                    return false;
                });

            });
        </script>

    </body>

{/block}
